<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>管理员界面</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 0;
            padding: 20px;
            background-color: #f5f5f5;
        }
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid #ddd;
        }
        .welcome {
            font-size: 18px;
            color: #333;
        }
        .logout-btn {
            padding: 5px 15px;
            background-color: #dc3545;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            text-decoration: none;
        }
        .logout-btn:hover {
            background-color: #c82333;
        }
        .content {
            background-color: white;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        .user-info {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .user-type {
            background-color: #6c757d;
            color: white;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 0.8rem;
        }
        .dashboard-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 20px;
            margin-top: 20px;
        }
        .dashboard-card {
            background: white;
            border-radius: 8px;
            padding: 20px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .dashboard-card h3 {
            margin-top: 0;
            color: #4361ee;
        }
        .stats {
            font-size: 24px;
            font-weight: bold;
            margin: 10px 0;
            color: #333;
        }
    </style>
</head>
<body>
<div class="header">
    <h1>系统管理后台</h1>
    <div class="user-info">
        <span class="welcome">欢迎, ${username}</span>
        <span class="user-type">${userType}</span>
        <a href="${pageContext.request.contextPath}/user/logout" class="logout-btn">退出登录</a>
    </div>
</div>

<div class="content">
    <h2>系统概览</h2>

    <div class="dashboard-grid">
        <div class="dashboard-card">
            <h3>用户管理</h3>
            <div class="stats">125</div>
            <p>系统注册用户总数</p>
            <a href="/admin/users">管理用户</a>
        </div>
        <div class="dashboard-card">
            <h3>学生管理</h3>
            <div class="stats">89</div>
            <p>注册学生总数</p>
            <a href="/admin/students">管理学生</a>
        </div>
        <div class="dashboard-card">
            <h3>教师管理</h3>
            <div class="stats">15</div>
            <p>注册教师总数</p>
            <a href="/admin/teachers">管理教师</a>
        </div>
        <div class="dashboard-card">
            <h3>课程管理</h3>
            <div class="stats">32</div>
            <p>系统课程总数</p>
            <a href="/admin/courses">管理课程</a>
        </div>
        <div class="dashboard-card">
            <h3>系统设置</h3>
            <p>配置系统参数和选项</p>
            <a href="/admin/settings">系统设置</a>
        </div>
        <div class="dashboard-card">
            <h3>数据统计</h3>
            <p>查看系统使用统计</p>
            <a href="/admin/statistics">查看统计</a>
        </div>
    </div>
</div>
</body>
</html>